"""
循环嵌套:
语法:
for  变量1 in 数据:
    for  变量2 in 数据:
        代码块
"""
# print("*"*4)
# print("*"*4)
# print("*"*4)
# 内层循环结束,不代表整个循环结束,他只代码内层循环结束,有可能外层循环继续
# n=3
# for a in range(0,n):   #外层的循环打印的行数
#     for b in range(0,n):#内层的循环打印的列表(每行的个数)
#         # pass
#         print("*",end="")
#     print()

# print("*"*1)
# print("*"*2)
# print("*"*3)
# print("*"*4)
# print("*"*5)

#不用嵌套
# for  a in range(1,6):
#     print("*"*a)


# 使用嵌套

# for a in range(1,6):
#     for b in range(a):
#         print("*",end="")
#     print()

# print("*"*1)
# print("*"*3)
# print("*"*5)
# print("*"*7)
# print("*"*9)

for a in range(1,10,2):
    print("*"*a)


# 使用嵌套
# for a in range(1,10,2):
#     for b in range(a):
#         print("*",end="")
#     print()

for a in range(1,6):
    for b in range(0,2*a-1):
        print("*", end="")
    print()